<!--
 * @Author: your name
 * @Date: 2021-09-18 17:15:36
 * @LastEditTime: 2022-08-19 16:08:53
 * @LastEditors: hq
 * @Description: In User Settings Edit
 * @FilePath: \wallet\src\views\main\index.vue
-->
<template>
  <div class="main-con">
    <div class="header">
      <div class="title1">
        <img class="logo" src="@/assets/logo2.png" alt="" />
        <div>中健荟通</div>
      </div>

      <div class="r">
        <el-dropdown @command="handleCommand">
          <span class="el-dropdown-link">
            <i class="el-icon-s-tools"></i>帮助中心
          </span>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item command="1">商家首页</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
        <el-popover
          class="loginout"
          placement="bottom"
          title=""
          width="50"
          trigger="click"
        >
          <div class="hand_cs tuichu" @click="loginOut">退出</div>
          <div slot="reference" class="hand_cs">
            欢迎您 ！{{ username }}
            <i class="el-icon-caret-bottom"></i>
          </div>
        </el-popover>
      </div>
    </div>
    <div class="con">
      <LeftMenu></LeftMenu>
      <div class="right">
        <router-view :key="$route.fullPath" />
        <div class="middle_main"></div>
      </div>
    </div>
  </div>
</template>

<script>
import LeftMenu from "@/components/left_menu.vue";
export default {
  components: { LeftMenu },
  data() {
    return {
      uername: "",
    };
  },
  methods: {
    handleSelect() {
      //   ("111");
    },
    handleIsCollapse() {
      //   this.isCollapse = !this.isCollapse;
    },
    loginOut() {
      this.$confirm("是否确认退出登录?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        sessionStorage.clear();
        // this.$message({
        //   type: "success",
        //   message: "退出成功!",
        // });
        this.$router.replace({
          path: "/login",
        });
      });
    },
    handleCommand(command) {
      if (command === "1") {
        window.open("https://help-mch.zgdjkpt.com", "_blank");
      }
    },
  },
  created() {
    this.username = sessionStorage.getItem("username");
  },
};
</script>

<style lang="scss" scoped>
@import "@/style/index.scss";
.breadcrum {
  font-size: 16px;
  margin-bottom: 13px;
}

.header {
  height: 60px;
  background-color: $color-primary7;
  color: #fff;
  display: flex;
  justify-content: space-between;
  .title1 {
    width: 230px;
    display: flex;
    // justify-content: space-between;
    align-items: center;
    font-size: 18px;
    padding-left: 30px;
    box-sizing: border-box;
    .logo {
      width: 35px;
      margin-right: 20px;
    }
  }
  .r {
    display: flex;
    align-items: center;
    padding-right: 40px;
    box-sizing: border-box;
    .link_bank {
      margin-right: 20px;
      color: $color-primary2;
      &:hover {
        color: $color-primary2;
        cursor: pointer;
      }
    }
    .help {
      color: #999999;
      margin-right: 20px;
    }
    .el-dropdown-link {
      cursor: pointer;
      color: #fff;
      margin-right: 25px;
      i {
        margin-right: 5px;
      }
    }
    .el-icon-arrow-down {
      font-size: 12px;
    }
  }
}

.main-con {
  height: 100%;
  .con {
    height: calc(100% - 60px);
    display: flex;
  }

  .secon {
    display: inline-block;
    width: 5px;
    height: 5px;
    background-color: #ccc;
    border-radius: 50%;
    margin-right: 10px;
  }
}
.right {
  flex: 1;
  text-align: start;
  background-color: #f6f6f6;
  height: calc(100vh - 60px);
  overflow: auto;
  padding: 20px;
  box-sizing: border-box;
  /deep/.el-breadcrumb__inner {
    cursor: pointer !important;
  }
  .right-head {
    height: 50px;
    background-color: #fff;
    padding: 0 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .l {
      display: flex;
      align-items: center;
      span {
        margin-left: 20px;
      }
    }
  }
}
.tuichu {
  text-align: center;
  &:hover {
    color: $color-primary1;
  }
}
</style>
<style>
.el-dropdown-menu__item:not(.is-disabled):hover {
  color: rgb(41, 120, 255);
}
/* .el-popover {
  width: 50px !important;
  min-width: 50px !important;
} */
</style>
